<?php include "header.html"; ?>

<div id="main">
<?php if($ts == 'list'){ ?>
<h3>信息列表</h3>
<table cellpadding="0" cellspacing="0">
<tr>
<td>ID</td><td>分类</td><td>标题</td><td>管理</td>
</tr>

<?php foreach($cmss as $key=>$cms){ ?>
<tr  class='odd'><td><?php echo $cms['id']; ?></td><td><?php echo $qicmsCate->getcmsCateName($cms['cid']); ?></td><td><?php echo $cms['title']; ?></td><td  class='action'><a href="#" class='view'>查看</a> <a href="index.php?action=cms&ts=edit&id=<?php echo $cms['id']; ?>" class='edit'>编辑</a> <a href="index.php?action=cms&ts=del&id=<?php echo $cms['id']; ?>">删除</a></td>
</tr>
<?php } ?>

</table>
<!-- <div class="manu">
分页
</div> --> 
<?php } ?>

<?php if($ts == 'add'){ ?>
<h3>添加信息</h3>
<fieldset>
<form method="POST"  class="jNice" action="index.php?action=cms&ts=add">
<p><label>标题：</label><input type="text" class="text-long" name="title" /></p>
<p><label>内容：</label><textarea name="content" style="width:600px;height:50px;"></textarea></p>
<p><label>分类：</label>
<select name="cid">
<?php foreach($cmsCates as $key=>$cmsCate){ ?>
<option value="<?php echo $cmsCate['id']; ?>"><?php echo $cmsCate['cname']; ?></option>
<?php } ?>
</select>
</p>
<input type="submit" value="添加信息" name="" />
</form>
</fieldset>
<?php } ?>

<?php if($ts == 'edit'){ ?>
<h3>编辑信息</h3>
<fieldset>
<form method="POST"  class="jNice" action="index.php?action=cms&ts=update&id=<?php echo $_GET['id']; ?>">
<p><label>标题：</label><input type="text" class="text-long" name="title" value="<?php echo $cmsData['title']; ?>" /></p>
<p><label>内容：</label><textarea name="content" style="width:600px;height:50px;"><?php echo $cmsData['content']; ?></textarea></p>
<p><label>分类：</label>
<select name="cid">
<?php foreach($cmsCates as $key=>$cmsCate){ ?>
<option value="<?php echo $cmsCate['id']; ?>"><?php echo $cmsCate['cname']; ?></option>
<?php } ?>
</select>
</p>
<input type="submit" value="修改信息" name="" />
</form>
</fieldset>
<?php } ?>

</div>

<?php include "footer.html"; ?>